def guess(num):
    return 1


class Solution(object):
    def guessNumber(self, n):
        """
        :type n: int
        :rtype: int
        """
        left = 1
        right = n
        while left < right:
            mid = (left + right) // 2
            result = guess(mid)
            if result == 0:
                return mid
            if result == 1:
                left = mid + 1
            else:
                right = mid - 1
        return left

